package com.iot.manage.service;

import com.alibaba.fastjson.JSONObject;
import com.iot.manage.dao.SysParamsMapper;
import com.iot.manage.pojo.SysParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class SysParamsService {

    @Autowired
    private SysParamsMapper sysParamsMapper;

    public List<SysParam> findSysParamsList(String query, int pagenum, int pagesize) {
        return sysParamsMapper.findSysParamsList(query,pagesize * (pagenum - 1),pagesize * pagenum);
    }

    public int countSysParamsList(String query) {
        return sysParamsMapper.countSysParamsList(query);
    }

    public void addSysParamsInfo(JSONObject params) {
        sysParamsMapper.addSysParamsInfo(params);
    }

    public SysParam findSysParamsInfoByParamEnName(String paramEnName) {
        return sysParamsMapper.findSysParamsInfoByParamEnName(paramEnName);
    }

    public void updateSysParamsInfo(JSONObject params) {
        sysParamsMapper.updateSysParamsInfo(params);
    }

    public void removeSysParamsInfo(String paramsEnName) {
        sysParamsMapper.removeSysParamsInfo(paramsEnName);
    }

}
